package com.simtop.util.worldUtil;

import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

/**
 * @ClassName: PdfUtil
 * @Description TODO
 * @Author liuzhaobo
 * @Date 2022/11/23 0023 9:23
 * @Version 1.0
 **/
public class PdfUtil {
    /**
     * MultipartFile 转换成File
     *
     * @param multfile 原文件类型
     * @return File
     */
    public static File multipartToFile(MultipartFile multfile) throws IOException {
        File file = null;
//        file = File.createTempFile("prefix","_" + multfile.getOriginalFilename());
        String projectPath = System.getProperty("user.dir");
        file = new File(projectPath + "/prefix_" + multfile.getOriginalFilename());

        multfile.transferTo(file);
        return file;
    }


}
